package com.pencilisland.pay.mgt.console.entity;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 后台功能菜单
 * 
 * @author Breeze
 *
 */
@Entity
@Table(name = "SYS_MENU")
public class SysMenu implements Serializable {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "MENU_ID")
	protected Long menuId;

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 菜单名称
	 */
	@Column(name = "MENU_NAME", length = 50)
	private String menuName;
	/**
	 * 菜单描述
	 */
	@Column(name = "MENU_DESC", length = 1000)
	private String menuDesc;
	/**
	 * 菜单链接
	 */
	@Column(name = "MENU_URL", length = 200)
	private String menuUrl;
	/**
	 * 菜单图标
	 */
	@Column(name = "MENU_ICON", length = 100)
	private String menuIcon;
	/**
	 * 菜单排序权重
	 */
	@Column(name = "MENU_WEIGHT")
	private Integer menuWeight;
	/**
	 * 父菜单ID
	 */
	@Column(name = "MENU_PARENT")
	private Long menuParent;
	
	@Transient
	private List<SysMenu> childList;
	
	public Long getMenuId() {
		return menuId;
	}

	public void setMenuId(Long menuId) {
		this.menuId = menuId;
	}

	public String getMenuName() {
		return menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	public String getMenuDesc() {
		return menuDesc;
	}

	public void setMenuDesc(String menuDesc) {
		this.menuDesc = menuDesc;
	}

	public String getMenuUrl() {
		return menuUrl;
	}

	public void setMenuUrl(String menuUrl) {
		this.menuUrl = menuUrl;
	}

	public String getMenuIcon() {
		return menuIcon;
	}

	public void setMenuIcon(String menuIcon) {
		this.menuIcon = menuIcon;
	}

	public Integer getMenuWeight() {
		return menuWeight;
	}

	public void setMenuWeight(Integer menuWeight) {
		this.menuWeight = menuWeight;
	}

	public Long getMenuParent() {
		return menuParent;
	}

	public void setMenuParent(Long menuParent) {
		this.menuParent = menuParent;
	}

	public Map<String, Object> getResource() {
		Map<String, Object> resource = new HashMap<String, Object>();
		resource.put("menuId", this.getMenuId());
		resource.put("menuName", this.getMenuName());
		resource.put("menuDesc", this.getMenuDesc());
		resource.put("menuUrl", this.getMenuUrl());
		resource.put("menuIconCls", this.getMenuIcon());
		resource.put("menuWeight", this.getMenuWeight());
		resource.put("menuParent", this.getMenuParent());
		return resource;
	}

	public List<SysMenu> getChildList() {
		return childList;
	}

	public void setChildList(List<SysMenu> childList) {
		this.childList = childList;
	}

}
